/* 全局样式 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --text-color: #333;
    --border-color: #ddd;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --border-radius: 5px;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f9f9f9;
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.loaded {
    opacity: 1;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--accent-color);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button, .btn-submit {
    cursor: pointer;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

button:hover, .btn-submit:hover {
    background-color: var(--accent-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
header {
    background-color: white;
    box-shadow: var(--box-shadow);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
}

nav ul {
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: var(--dark-color);
    font-weight: 500;
    padding: 10px;
    border-radius: var(--border-radius);
}

nav ul li a:hover, nav ul li a.active {
    color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.1);
}

/* 移动菜单样式 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 25px;
    position: relative;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 101;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--secondary-color);
    border-radius: 3px;
    transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

/* 滚动到顶部按钮 */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background-color: var(--accent-color);
    transform: translateY(-5px);
}

/* 首页样式 */
.showcase {
    background-color: var(--primary-color);
    color: white;
    padding: 100px 0;
    text-align: center;
}

.showcase h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.featured-posts {
    padding: 80px 0;
}

.featured-posts h2 {
    text-align: center;
    margin-bottom: 40px;
    color: var(--secondary-color);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.post-card {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.post-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-content {
    padding: 20px;
}

.post-content h3 {
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.post-date {
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: block;
}

.read-more {
    display: inline-block;
    margin-top: 15px;
    font-weight: 500;
}

/* 博客页面样式 */
.blog-header {
    background-color: var(--light-color);
    padding: 50px 0;
    text-align: center;
}

.blog-filter {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    gap: 15px;
}

#search-posts, #category-filter {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    width: 200px;
}

#category-filter {
    cursor: pointer;
}

.blog-posts {
    padding: 60px 0;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.post-item {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-details {
    padding: 20px;
}

.post-category {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.post-details h3 {
    margin-bottom: 10px;
}

.post-details h3 a {
    color: var(--secondary-color);
}

.post-details h3 a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    margin: 15px 0;
    color: #555;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 50px;
    gap: 10px;
}

.pagination a {
    padding: 8px 15px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-color);
}

.pagination a.active, .pagination a:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 关于我页面样式 */
.about-header {
    background-color: var(--light-color);
    padding: 50px 0;
    text-align: center;
}

.about-content {
    padding: 60px 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 50px;
    margin-bottom: 50px;
}

.about-image img {
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.about-text h3 {
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.about-text p {
    margin-bottom: 15px;
}

.skills, .experience {
    margin-top: 50px;
}

.skills h3, .experience h3 {
    margin-bottom: 30px;
    color: var(--secondary-color);
    text-align: center;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.skill-item h4 {
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.skill-bar {
    height: 10px;
    background-color: var(--light-color);
    border-radius: 5px;
    overflow: hidden;
}

.skill-level {
    height: 100%;
    background-color: var(--primary-color);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: var(--border-color);
    top: 0;
    bottom: 0;
    left: 50px;
    margin-left: -1px;
}

.timeline-item {
    padding: 20px 40px 20px 80px;
    position: relative;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
}

.timeline-date {
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.timeline-content h4 {
    margin-bottom: 5px;
    color: var(--secondary-color);
}

.timeline-company {
    color: #777;
    font-style: italic;
    margin-bottom: 10px;
}

/* 联系页面样式 */
.contact-header {
    background-color: var(--light-color);
    padding: 50px 0;
    text-align: center;
}

.contact-content {
    padding: 60px 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.contact-form, .contact-info {
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.contact-form h3, .contact-info h3 {
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--secondary-color);
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
}

.btn-submit {
    margin-top: 10px;
    width: 100%;
}

.info-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.info-item img {
    width: 20px;
    margin-right: 15px;
}

.social-media {
    margin-top: 30px;
}

.social-media h4 {
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icon img {
    width: 30px;
}

.map-section {
    margin-top: 60px;
    text-align: center;
}

.map-section h3 {
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.map-container {
    height: 400px;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.map-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 博客文章页面样式 */
.post-container {
    padding: 60px 0;
}

.post-header {
    text-align: center;
    margin-bottom: 30px;
}

.post-header h2 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.post-meta {
    color: #777;
    font-size: 0.9rem;
}

.post-meta span {
    margin: 0 10px;
}

.post-image {
    margin-bottom: 30px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.post-image img {
    width: 100%;
}

.post-content {
    line-height: 1.8;
    color: #444;
}

.post-content h3 {
    color: var(--secondary-color);
    margin: 30px 0 15px;
}

.post-content h4 {
    color: var(--secondary-color);
    margin: 25px 0 15px;
}

.post-content p {
    margin-bottom: 20px;
}

.post-content ul, .post-content ol {
    margin: 20px 0;
    padding-left: 20px;
}

.post-content li {
    margin-bottom: 10px;
}

.post-content pre {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 20px 0;
}

.post-content code {
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 0.9em;
}

.post-tags {
    margin: 40px 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.tag-label {
    margin-right: 10px;
    font-weight: bold;
}

.tag {
    display: inline-block;
    background-color: var(--light-color);
    padding: 5px 10px;
    border-radius: 20px;
    margin: 5px;
    font-size: 0.85rem;
    color: var(--text-color);
}

.tag:hover {
    background-color: var(--primary-color);
    color: white;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.prev-post, .next-post, .empty-nav {
    flex: 1;
}

.next-post {
    text-align: right;
}

.share-post {
    margin: 40px 0;
    text-align: center;
}

.share-post h3 {
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.share-button img {
    width: 30px;
}

.related-posts {
    margin: 60px 0;
}

.related-posts h3 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--secondary-color);
}

/* 页脚样式 */
footer {
    background-color: var(--secondary-color);
    color: white;
    padding: 40px 0;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links img {
    width: 24px;
    filter: brightness(0) invert(1);
}

/* 响应式设计 */
@media screen and (max-width: 992px) {
    .about-grid, .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .about-image {
        text-align: center;
        max-width: 300px;
        margin: 0 auto;
    }
}

@media screen and (max-width: 768px) {
    header .container {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    nav {
        width: 100%;
        height: 0;
        overflow: hidden;
        transition: height 0.3s ease;
    }
    
    nav.active {
        height: auto;
        margin-top: 20px;
    }
    
    nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    nav ul li {
        margin: 10px 0;
        width: 100%;
        text-align: center;
    }
    
    nav ul li a {
        display: block;
        padding: 10px;
    }
    
    .post-item {
        grid-template-columns: 1fr;
    }
    
    .post-thumbnail img {
        height: 200px;
    }
    
    .timeline::after {
        left: 20px;
    }
    
    .timeline-item {
        padding-left: 50px;
    }
    
    footer .container {
        flex-direction: column;
        text-align: center;
    }
    
    .social-links {
        margin-top: 20px;
        justify-content: center;
    }
}

@media screen and (max-width: 576px) {
    nav ul li {
        margin: 5px 0;
    }
    
    .blog-filter {
        flex-direction: column;
        align-items: center;
    }
    
    .showcase {
        padding: 60px 0;
    }
    
    .showcase h2 {
        font-size: 2rem;
    }
    
    .post-header h2 {
        font-size: 2rem;
    }

    .scroll-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
} 